lib/commit: Include object type in sizes metadata
authorJohn Hiesey <john@hiesey.com>
Thu, 24 Oct 2019 15:10:57 +0000 (09:10 -0600)
committerDan Nicholson <nicholson@endlessm.com>
Tue, 21 Jan 2020 03:42:27 +0000 (20:42 -0700)
commit291e9da258dc2c5b7cd5191f1c29e9b5f9d79b3b
tree2256d078bc5fd841aade856bf2ad29ae8739a5ba
parenta4592678aa5b71051daed24d08bcc84d8844781c
lib/commit: Include object type in sizes metadata

Append a byte encoding the OSTree object type for each object in the
metadata. This allows the commit metadata to be fetched and then for the
program to see which objects it already has for an accurate calculation
of which objects need to be downloaded.

This slightly breaks the `ostree.sizes` `ay` metadata entries. However,
it's unlikely anyone was asserting the length of the entries since the
array currently ends in 2 variable length integers. As far as I know,
the only users of the sizes metadata are the ostree test suite and
Endless' eos-updater[1]. The former is updated here and the latter
already expects this format.

1. https://github.com/endlessm/eos-updater/
src/libostree/ostree-repo-commit.c
tests/test-sizes.js